package cn.darkbox.sdk.zpdf;

import android.graphics.Color;
import android.graphics.Rect;

import java.util.ArrayList;
import java.util.List;

public class PDFConfig {
    public int pageWidth;
    public int pageHeight;
    public Rect pageOffset = new Rect();
    public List<PDFPageBitmap> pdfPageBitmaps = new ArrayList<>();
    public float scale = 1;
    public int pageColor = Color.WHITE;
    public int textColor;
    public int textSize;

    public PDFConfig() {

    }

    public int getPageContentHeight() {
        int pageContentHeight = pageHeight;
        if (pageOffset != null) {
            pageContentHeight = pageContentHeight - pageOffset.top - pageOffset.bottom;
        }

        return pageContentHeight;
    }

    public int getPreviewPageContentHeight() {
        return (int) (getPageContentHeight() * scale);
    }

    public int getPreviewWidth() {
        return (int) (pageWidth * scale);
    }

    public int getPreviewHeight() {
        return (int) (pageHeight * scale);
    }

    public int getPaddingL() {
        return (int) (pageOffset.left * scale);
    }

    public int getPaddingT() {
        return (int) (pageOffset.top * scale);
    }

    public int getPaddingR() {
        return (int) (pageOffset.right * scale);
    }

    public int getPaddingB() {
        return (int) (pageOffset.bottom * scale);
    }
}
